package com.own.component.elastic.exception;

import com.own.base.BaseResponseCode;
import lombok.AllArgsConstructor;

/**
 * ElasticExceptionEnum
 *
 * @author chenxueli
 * @date 2021-08-27 14:28:52
 */
@SuppressWarnings("all")
@AllArgsConstructor
public enum ElasticExceptionEnum implements BaseResponseCode {

    DEFAULT("elastic_error", "es搜索引擎处理异常"),
    LINK_ERROR("elastic_link_error", "es搜索引擎连接异常"),

    DATA_SAVE_ERROR("elastic_data_save_error", "数据保存异常"),
    DATA_DELETE_ERROR("elastic_data_delete_error", "数据删除异常"),
    DATA_UPDATE_ERROR("elastic_data_update_error", "数据修改异常"),
    DATA_SEARCH_ERROR("elastic_data_search_error", "数据查询异常"),

    INDEX_CREATE_ERROR("elastic_index_create_error", "创建索引异常"),
    INDEX_EXIST_ERROR("elastic_index_exist_error", "查询索引异常"),
    INDEX_DELETE_ERROR("elastic_index_delete_error", "删除索引异常"),
    ;

    /**
     * 返回状态码
     */
    private final String code;

    /**
     * 描述
     */
    private final String desc;

    /**
     * 获取返回信息
     *
     * @return 返回code
     */
    @Override
    public String code() {
        return this.code;
    }

    /**
     * 获取描述
     *
     * @return 返回描述
     */
    @Override
    public String desc() {
        return this.desc;
    }

}
